<?php

namespace App\Model;


use App\Model\BaseModel;

class User extends BaseModel
{
    protected $table = "users";

    //用户的文章
    public function posts(){
    	return $this->hasMany(Post::class,'user_id','id');
    }

    //关注我的
    public function fans(){
    	return $this->hasMany(Fan::class,'star_id','id');
    }

    //我关注的
    public function stars(){
    	return $this->hasMany(Fan::class,'fan_id','id');
    }

    
}
